//随机数
function rand(min, max) {
	return parseInt(Math.random() * (max - min + 1) + min);
}
//颜色随机
function randColor() {
	var r = Math.floor(Math.random() * (255 - 1 + 1) + 1);
	var g = Math.floor(Math.random() * (255 - 1 + 1) + 1);
	var b = Math.floor(Math.random() * (255 - 1 + 1) + 1);
	return "rgb(" + r + "," + g + "," + b + ")";
}
randColor();
//碰撞检测
function checkRecPeng(myObj, targetObj) {
	if(myObj.offsetLeft + myObj.offsetWidth >= targetObj.offsetLeft &&
		myObj.offsetTop + myObj.offsetHeight >= targetObj.offsetTop &&
		targetObj.offsetLeft + targetObj.offsetWidth >= myObj.offsetLeft &&
		targetObj.offsetTop + targetObj.offsetHeight >= myObj.offsetTop) {
		return true;
	} else {
		return false;
	}
}
